/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_userorder")
//@NamedQueries({@NamedQuery(name = "NewsUserorder.findAll", query = "SELECT n FROM NewsUserorder n"), @NamedQuery(name = "NewsUserorder.findByClientid", query = "SELECT n FROM NewsUserorder n WHERE n.newsUserorderPK.clientid = :clientid"), @NamedQuery(name = "NewsUserorder.findByMobile", query = "SELECT n FROM NewsUserorder n WHERE n.mobile = :mobile"), @NamedQuery(name = "NewsUserorder.findByContentid", query = "SELECT n FROM NewsUserorder n WHERE n.newsUserorderPK.contentid = :contentid"), @NamedQuery(name = "NewsUserorder.findByContendchannel", query = "SELECT n FROM NewsUserorder n WHERE n.contendchannel = :contendchannel"), @NamedQuery(name = "NewsUserorder.findByOrdertime", query = "SELECT n FROM NewsUserorder n WHERE n.ordertime = :ordertime"), @NamedQuery(name = "NewsUserorder.findByOrdertype", query = "SELECT n FROM NewsUserorder n WHERE n.ordertype = :ordertype"), @NamedQuery(name = "NewsUserorder.findByDisordertime", query = "SELECT n FROM NewsUserorder n WHERE n.disordertime = :disordertime")})
public class NewsUserorder implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NewsUserorderPK newsUserorderPK;
    @Column(name = "mobile")
    private String mobile;
    @Column(name = "contendchannel")
    private String contendchannel;
    @Column(name = "ordertime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ordertime;
    @Column(name = "ordertype")
    private String ordertype;
    @Column(name = "disordertime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date disordertime;
    @JoinColumn(name = "clientid", referencedColumnName = "clientid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private NewsClientinfo newsClientinfo;

    public NewsUserorder() {
    }

    public NewsUserorder(NewsUserorderPK newsUserorderPK) {
        this.newsUserorderPK = newsUserorderPK;
    }

    public NewsUserorder(int clientid, int contentid) {
        this.newsUserorderPK = new NewsUserorderPK(clientid, contentid);
    }

    public NewsUserorderPK getNewsUserorderPK() {
        return newsUserorderPK;
    }

    public void setNewsUserorderPK(NewsUserorderPK newsUserorderPK) {
        this.newsUserorderPK = newsUserorderPK;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getContendchannel() {
        return contendchannel;
    }

    public void setContendchannel(String contendchannel) {
        this.contendchannel = contendchannel;
    }

    public Date getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(Date ordertime) {
        this.ordertime = ordertime;
    }

    public String getOrdertype() {
        return ordertype;
    }

    public void setOrdertype(String ordertype) {
        this.ordertype = ordertype;
    }

    public Date getDisordertime() {
        return disordertime;
    }

    public void setDisordertime(Date disordertime) {
        this.disordertime = disordertime;
    }

    public NewsClientinfo getNewsClientinfo() {
        return newsClientinfo;
    }

    public void setNewsClientinfo(NewsClientinfo newsClientinfo) {
        this.newsClientinfo = newsClientinfo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (newsUserorderPK != null ? newsUserorderPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsUserorder)) {
            return false;
        }
        NewsUserorder other = (NewsUserorder) object;
        if ((this.newsUserorderPK == null && other.newsUserorderPK != null) || (this.newsUserorderPK != null && !this.newsUserorderPK.equals(other.newsUserorderPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsUserorder[newsUserorderPK=" + newsUserorderPK + "]";
    }

}
